package com.gouda.temporary.vo.openwx;

import com.gouda.temporary.vo.BaseVO;

import java.util.ArrayList;

public class TextMsgBody extends BaseVO {

    private String touser;

    private String msgtype;

    private String toparty;

    private int    agentid;

    private News   news;

    public static class News {
        private ArrayList<Articles> articles = new ArrayList<Articles>();

        public ArrayList<Articles> getArticles() {
            return articles;
        }

        public void setArticles(ArrayList<Articles> articles) {
            this.articles = articles;
        }

        public static class Articles {
            private String title;

            private String description;

            private String url;

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getDescription() {
                return description;
            }

            public void setDescription(String description) {
                this.description = description;
            }

            public String getUrl() {
                return url;
            }

            public void setUrl(String url) {
                this.url = url;
            }
        }
    }

    public String getToparty() {
        return toparty;
    }

    public void setToparty(String toparty) {
        this.toparty = toparty;
    }

    public String getTouser() {
        return touser;
    }

    public void setTouser(String touser) {
        this.touser = touser;
    }

    public String getMsgtype() {
        return msgtype;
    }

    public void setMsgtype(String msgtype) {
        this.msgtype = msgtype;
    }

    public int getAgentid() {
        return agentid;
    }

    public void setAgentid(int agentid) {
        this.agentid = agentid;
    }

    public News getNews() {
        return news;
    }

    public void setNews(String title, String desciption, String url) {
        this.news =new News();

        News.Articles articles = new News.Articles();
        articles.setTitle(title);
        articles.setDescription(desciption);
        articles.setUrl(url);

        ArrayList<News.Articles> arrayList = new ArrayList<News.Articles>();
        arrayList.add(articles);

        this.news.setArticles(arrayList);
    }

    @Override
    public String toString() {
        return "TextMsgBody{" +
                "touser='" + touser + '\'' +
                ", msgtype='" + msgtype + '\'' +
                ", agentid=" + agentid +
                ", news=" + news +
                '}';
    }
}
